home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Utilities / Content Creation Tool Plug-Ins / Maya / Sources / DXCC.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-27  |  63.6 KB  |  1,901 lines

  1. #pragma once
  2. #ifndef __DXCC_H__
  3. #define __DXCC_H__
  4.  
  5.  
  6. //#ifndef WIN32_LEAN_AND_MEAN
  7. //#define WIN32_LEAN_AND_MEAN
  8. //#endif
  9.  
  10. //unreferenced label
  11. #pragma warning(disable : 4102)
  12. //if statement is constant
  13. #pragma warning(disable : 4127)
  14. //unreachable code
  15. #pragma warning(disable : 4702)
  16. //local variable initialized but not used
  17. #pragma warning(disable : 4189)
  18. //formal parameter unreferenced
  19. #pragma warning(disable : 4100)
  20. //local variable unreferenced
  21. #pragma warning(disable : 4100)
  22. //local variable unreferenced
  23. #pragma warning(disable : 4101)
  24. //conversion truncation
  25. #pragma warning(disable : 4311)
  26. //conversion has more room than expection
  27. #pragma warning(disable : 4312)
  28. //conversion possible loss of data
  29. #pragma warning(disable : 4244)
  30. //return conversion possible loss of data
  31. #pragma warning(disable : 4267)
  32.  
  33.  
  34.  
  35. #include "initguid.h"
  36. #include "comdef.h"
  37.  
  38.  
  39. #include "d3d9.h"
  40. #include "d3dx9.h"
  41. #include <stdlib.h>
  42.  
  43. //#define COM_NO_WINDOWS_H
  44. //#include <objbase.h>
  45. //#include <windows.h>
  46. //#if defined( _WIN32 ) && !defined( _NO_COM)
  47.  
  48. typedef struct        DXCCWindow                    DXCCWindow                        ,*LPDXCCWINDOW;
  49. typedef interface    IDXCCHeap                    IDXCCHeap                        ,*LPDXCCHEAP;
  50. typedef interface    IDXCCResource                IDXCCResource                    ,*LPDXCCRESOURCE;
  51. typedef interface    IDXCCManager                IDXCCManager                    ,*LPDXCCMANAGER;
  52. typedef interface    IDXCCFrame                    IDXCCFrame                        ,*LPDXCCFRAME;
  53. typedef interface    IDXCCFrameIterator            IDXCCFrameIterator                ,*LPDXCCFRAMEITERATOR;
  54. typedef interface    IDXCCMesh                    IDXCCMesh                        ,*LPDXCCMESH;
  55. typedef interface    IDXCCDeclaration            IDXCCDeclaration                ,*LPDXCCDECLARATION;
  56. typedef interface    IDXCCVertexBundler            IDXCCVertexBundler                ,*LPDXCCVERTEXBUNDLER;
  57. //typedef interface    IDXCCMaterial                IDXCCMaterial                    ,*LPDXCCMATERIAL;
  58. typedef interface    IDXCCAnimationStream        IDXCCAnimationStream            ,*LPDXCCANIMATIONSTREAM;
  59.  
  60. typedef struct        DXCCSaveSceneArgs            DXCCSaveSceneArgs                ,*LPDXCCSAVESCENEARGS;
  61.  
  62. typedef interface    IDXCCSaveUserData            IDXCCSaveUserData                ,*LPDXCCSAVEUSERDATA;
  63. typedef interface    IDXCCEnumEffectParameters    IDXCCEnumEffectParameters        ,*LPDXCCENUMEFFECTPARAMETERS;
  64. typedef interface    IDXCCEffectDlgCallbacks        IDXCCEffectDlgCallbacks            ,*LPDXCCFXDLGCALLBACKS;
  65. typedef interface    IDXCCHierarchyCallbacks        IDXCCHierarchyCallbacks            ,*LPDXCCHIERARCHYCALLBACKS;
  66.  
  67. //pointers to internal data
  68. typedef const        ID3DXMesh*                    LPCD3DXMESH;
  69. typedef const        ID3DXSkinInfo*                LPCD3DXSKININFO;
  70.  
  71. typedef UINT        DXCCHANDLE;
  72. typedef DWORD        DXCCATTRIBUTE;
  73. typedef UINT_PTR    DXCCATTRIBUTE3264;
  74. typedef UINT64        DXCCATTRIBUTE64;
  75.  
  76.  
  77. interface __declspec( uuid("640ed315-dec3-477e-84ce-17d7ce2f11da") ) IDXCCMesh;
  78. DEFINE_GUID( IID_IDXCCMesh, 
  79.             0x640ed315, 
  80.             0xdec3, 
  81.             0x477e, 
  82.             0x84, 0xce, 0x17, 0xd7, 0xce, 0x2f, 0x11, 0xda);
  83.  
  84. interface __declspec( uuid("f9acf835-d202-4ccb-a42c-6bb79cafdc48") ) IDXCCFrame;
  85. DEFINE_GUID( IID_IDXCCFrame, 
  86.             0xf9acf835, 
  87.             0xd202, 
  88.             0x4ccb, 
  89.             0xa4, 0x2c, 0x6b, 0xb7, 0x9c, 0xaf, 0xdc, 0x48);
  90.  
  91. interface __declspec( uuid("8d7815e8-3589-4938-bdab-366dbc57424d") ) IDXCCDeclaration;
  92. DEFINE_GUID( IID_IDXCCDeclaration, 
  93.     0x8d7815e8, 
  94.     0x3589, 
  95.     0x4938, 
  96.     0xbd, 0xab, 0x36, 0x6d, 0xbc, 0x57, 0x42, 0x4d);
  97.  
  98. interface __declspec( uuid("8dd12056-b4e3-4195-976a-5fc56c2d8ae0") ) IDXCCHeap;
  99. DEFINE_GUID( IID_IDXCCHeap, 
  100.     0x8dd12056, 
  101.     0xb4e3, 
  102.     0x4195, 
  103.     0x97, 0x6a, 0x5f, 0xc5, 0x6c, 0x2d, 0x8a, 0xe0);
  104.  
  105. interface __declspec( uuid("c39daab3-5e71-43ba-9218-d25c947d746f") ) IDXCCVertexBundler;
  106. DEFINE_GUID( IID_IDXCCVertexBundler, 
  107.             0xc39daab3, 
  108.             0x5e71, 
  109.             0x43ba, 
  110.             0x92, 0x18, 0xd2, 0x5c, 0x94, 0x7d, 0x74, 0x6f);
  111.  
  112. interface __declspec( uuid("435d9fb7-e9df-4d5e-ab69-d7cf54332d4e") ) IDXCCManager;
  113. DEFINE_GUID( IID_IDXCCManager,
  114.             0x435d9fb7, 
  115.             0xe9df, 
  116.             0x4d5e, 
  117.             0xab, 0x69, 0xd7, 0xcf, 0x54, 0x33, 0x2d, 0x4e);
  118.  
  119. interface __declspec( uuid("75ebc313-afa7-4f1b-80f7-2b1256a28b29") ) IDXCCResource;
  120. DEFINE_GUID( IID_IDXCCResource, 
  121.             0x75ebc313, 
  122.             0xafa7, 
  123.             0x4f1b, 
  124.             0x80, 0xf7, 0x2b, 0x12, 0x56, 0xa2, 0x8b, 0x29);
  125.  
  126.  
  127. interface __declspec( uuid("ae831c8a-7d7d-4959-be8f-0f5b82699367") ) IDXCCAnimationStream;
  128. DEFINE_GUID( IID_IDXCCAnimationStream,
  129.     0xae831c8a,
  130.     0x7d7d,
  131.     0x4959,
  132.     0xbe, 0x8f, 0x0f, 0x5b, 0x82, 0x69, 0x93, 0x67);
  133.  
  134. interface __declspec( uuid("64a4b9a0-58d4-4d00-9e8f-14bc96fab35c") ) IDXCCFrameIterator;
  135. DEFINE_GUID( IID_IDXCCFrameIterator, 
  136.     0x64a4b9a0,
  137.     0x58d4,
  138.     0x4d00,
  139.     0x9e, 0x8f, 0x14, 0xbc, 0x96, 0xfa, 0xb3, 0x5c);
  140.  
  141.  
  142.  
  143.  
  144. #define DXCC_DEFAULT_STRING_LENGTH 256
  145.  
  146. #ifdef _DEBUG
  147.     #define DXCC_DPFA_MESSAGE                    DXCCDebugPrintfMessageA
  148.     #define DXCC_DPFW_MESSAGE                    DXCCDebugPrintfMessageW
  149.     #define DXCC_DPFA_SHORT                        DXCCDebugPrintfA
  150.     #define DXCC_DPFW_SHORT                        DXCCDebugPrintfW
  151.     #define DXCC_DPFA_REPORT                    DXCC_DPF_HEADER(TEXT("INFO")), DXCC_DPFA_MESSAGE
  152.     #define DXCC_DPFW_REPORT                    DXCC_DPF_HEADER(TEXT("INFO")), DXCC_DPFW_MESSAGE
  153.     #define DXCC_DPFA_ERROR                        DXCC_DPF_HEADER(TEXT("ERROR")), DXCC_DPFA_MESSAGE
  154.     #define DXCC_DPFW_ERROR                        DXCC_DPF_HEADER(TEXT("ERROR")), DXCC_DPFW_MESSAGE
  155.     #define DXCC_DPFA                            DXCC_DPFA_REPORT
  156.     #define DXCC_DPFW                            DXCC_DPFW_REPORT
  157.     #define DXCC_DPF_HEADER(_type_)                DXCCDebugPrintfHeader( _type_, TEXT( __FILE__ ) , __LINE__, TEXT( __FUNCTION__ ) )
  158.     #define DXCC_DPF_STATUS( _status_ )            DXCCDebugPrintfHRESULT(_status_)
  159.  
  160.     #define DXCC_ASSERT(_exp_)                    do{ if(!(_exp_)){ DXCC_DPF_HEADER(TEXT("ASSERT")); DXCC_DPF_MESSAGE(TEXT( #_exp_ )); _asm{int 3};} }while(0)
  161.     #define DXCC_ASSERT_RANGE(min, exp, max)    DXCC_ASSERT(((min) >= (exp))&&((exp) <= (max)))
  162.     #define DXCC_ASSERT_EXCEPTIONS_BEGIN()        try{
  163.     #define DXCC_ASSERT_EXCEPTIONS_END()        }catch(...){DXCC_ASSERT(FALSE);throw;}
  164.     #define DXCC_SUCCEEDED(_hr_)                SUCCEEDED(_hr_)
  165.     #define DXCC_FAILED(_hr_)                    ( FAILED(_hr_) ? DXCC_DPF_STATUS(_hr_), TRUE : FALSE )
  166.  
  167.     #ifdef _MEMDEBUG
  168.         #define DXCCCREATEBUFFER(_size_, _ppBuf_)                                        \
  169.                                                     (DXCCDebugPrintfHeader( TEXT("NEW BUFFER"), TEXT(__FILE__), __LINE__, TEXT(__FUNCTION__)),    \
  170.                                                     DXCC_DPF_MESSAGE( TEXT("SIZE:%d"), (_size_)),                                        \
  171.                                                     D3DXCreateBuffer((_size_), (_ppBuf_)))
  172.     #else 
  173.         #define DXCCCREATEBUFFER(_size_, _ppBuf_)    D3DXCreateBuffer(_size_, _ppBuf_)
  174.  
  175.     #endif
  176.  
  177. #else 
  178.     #define DXCC_DPFA_MESSAGE                    
  179.     #define DXCC_DPFW_MESSAGE                    
  180.     #define DXCC_DPFA_REPORT                        
  181.     #define DXCC_DPFW_REPORT                        
  182.     #define DXCC_DPFA_ERROR                        
  183.     #define DXCC_DPFW_ERROR                        
  184.     #define DXCC_DPFA_SHORT    
  185.     #define DXCC_DPFW_SHORT
  186.     #define DXCC_DPFA    
  187.     #define DXCC_DPFW    
  188.     #define DXCC_DPF_HEADER(_type_)    
  189.     #define DXCC_DPF_STATUS(_status_)            
  190.  
  191.     #define DXCC_ASSERT(_exp_)    
  192.     #define DXCC_ASSERT_RANGE(min, exp, max)
  193.     #define DXCC_ASSERT_EXCEPTIONS_BEGIN()            
  194.     #define DXCC_ASSERT_EXCEPTIONS_END()            
  195.     #define DXCC_SUCCEEDED(_hr_)                SUCCEEDED(_hr_)
  196.     #define DXCC_FAILED(_hr_)                    FAILED(_hr_)
  197.  
  198.     #define DXCCCREATEBUFFER(_size_, _ppBuf_)    D3DXCreateBuffer(_size_, _ppBuf_)
  199.  
  200. #endif
  201.  
  202.  
  203. #define DXCC_STATUS_EXIT(_hr,_Value,_e_Exit,_Break)        do{ (_hr)=(_Value); DXCC_GOTO_EXIT(_e_Exit, _Break); }while(0)
  204. #define DXCC_GOTO_EXIT(_e_Exit, _Break)                    do{ DXCC_ASSERT(!(_Break)); goto _e_Exit; }while(0)
  205.  
  206. #define DXCC_RELEASE(pIUK)                                DXCCInterfaceRelease((LPUNKNOWN*)&(pIUK))
  207.  
  208. //#define DXCCFXDLGEFFECTLOADPROC DXCCFxDlgEffectLoadProc
  209. //#define DXCCFXDLGEFFECTCHANGEPROC DXCCFxDlgEffectChangeProc
  210. //#define DXCCFXDLGPARAMETERCHANGEPROC DXCCFxDlgParameterChangeProc
  211.  
  212. inline ULONG DXCCInterfaceRelease(LPUNKNOWN* ppUnknown);
  213.  
  214. VOID cdecl DXCCDebugPrintfHRESULT(HRESULT hr);
  215. VOID cdecl DXCCDebugPrintfHeaderA(LPCSTR strReportType, LPCSTR strFile, UINT nLine, LPCSTR strFunction);
  216. VOID cdecl DXCCDebugPrintfHeaderW(LPCWSTR strReportType, LPCWSTR strFile, UINT nLine, LPCWSTR strFunction);
  217. VOID cdecl DXCCDebugPrintfMessageA(LPCSTR szFormat, ...);
  218. VOID cdecl DXCCDebugPrintfMessageW(LPCWSTR szFormat, ...);
  219. VOID cdecl DXCCDebugPrintfA(LPCSTR szFormat, ...);
  220. VOID cdecl DXCCDebugPrintfW(LPCWSTR szFormat, ...);
  221.  
  222. #ifndef _UNICODE
  223.     #define DXCC_DPF_MESSAGE    DXCC_DPFA_MESSAGE
  224.     #define DXCC_DPF_REPORT        DXCC_DPFA_REPORT
  225.     #define DXCC_DPF_ERROR        DXCC_DPFA_ERROR
  226.     #define DXCC_DPF            DXCC_DPFA
  227.     #define DXCCDebugPrintfHeader DXCCDebugPrintfHeaderA
  228.     #define DXCCDebugPrintfMessage DXCCDebugPrintfMessageA
  229.     #define DXCCDebugPrintf DXCCDebugPrintfA
  230. #else
  231.     #define DXCC_DPF_MESSAGE    DXCC_DPFW_MESSAGE
  232.     #define DXCC_DPF_REPORT        DXCC_DPFW_REPORT
  233.     #define DXCC_DPF_ERROR        DXCC_DPFW_ERROR
  234.     #define DXCC_DPF            DXCC_DPFW
  235.     #define DXCCDebugPrintfHeader DXCCDebugPrintfHeaderW
  236.     #define DXCCDebugPrintfMessage DXCCDebugPrintfMessageW
  237.     #define DXCCDebugPrintf DXCCDebugPrintfW
  238. #endif
  239.  
  240.  
  241. //typedef HRESULT (CALLBACK* DXCCFxDlgEffectLoadProc)(
  242. //     HWND hDialog, 
  243. //     LPDXCCMANAGER pMyManager,
  244. //     LPDIRECT3DDEVICE9 pDevice,
  245. //     LPCSTR szNewEffectFilename,
  246. //    LPD3DXEFFECT* ppNewEffect);
  247. //
  248. //typedef HRESULT (CALLBACK* DXCCFxDlgEffectChangeProc)(
  249. //     HWND hDialog,  
  250. //     LPDXCCMANAGER pMyManager,
  251. //     LPDIRECT3DDEVICE9 pDevice,
  252. //     LPD3DXEFFECT pNewEffect,
  253. //    LPDXCCRESOURCE pNewEffectResource);
  254. //
  255. //typedef HRESULT (CALLBACK* DXCCFxDlgParameterChangeProc)(
  256. //     HWND hDialog, 
  257. //     LPDXCCMANAGER pMyManager, 
  258. //     LPDIRECT3DDEVICE9 pDevice,
  259. //     LPD3DXEFFECT pEffect, 
  260. //     LPDXCCRESOURCE pEffectResource,
  261. //     HWND hParamterWindow, 
  262. //     D3DXHANDLE hRootParameter,
  263. //     D3DXHANDLE hNewParameter);
  264.  
  265.  
  266. #ifdef DXCC_EXPORTS
  267.     #define EXPORTDEF __declspec(dllexport)
  268. #else
  269.     #define EXPORTDEF
  270. #endif
  271.  
  272. enum DXCCIteratorType
  273. {
  274.     DXCCITERATOR_DEPTHFIRST,
  275.     DXCCITERATOR_BREADTH,
  276. };
  277.  
  278. enum DXCCTOD3DX_FLAGS
  279. {
  280.     //DXCCTOD3DX_NEW= 0x1,//create a new structure with creatememory on manager. use ExtensionSize to define how much larger than D3DXMESHCONTAINER //uses DXCCTOD3DX_CLEAN
  281.     //DXCCTOD3DX_CLEAN= 0x2,//zeromemory before a refresh
  282.     //DXCCTOD3DX_REFRESH= 0x4,//refresh the members maintained by DXCC
  283.     //DXCCTOD3DX_MANAGED= 0x8, //DXCCTOD3DX_REFRESH and continue to refresh
  284.     DXCCTOD3DX_NOADDREF= 0x10, //addref to any internal interfaces
  285.     DXCCTOD3DX_UNQUALIFYPATHS= 0x20,
  286. };
  287.  
  288. enum DXCCTOD3DXMESH_FLAGS
  289. {
  290.     DXCCTOD3DXMESH_NONAME= 0x40,
  291.     DXCCTOD3DXMESH_NOSKIN= 0x80,
  292.     DXCCTOD3DXMESH_NOADJACENCY= 0x100,
  293.     DXCCTOD3DXMESH_NOMATERIALS= 0x200,
  294.     DXCCTOD3DXMESH_NOEFFECTS= 0x400,
  295.     DXCCTOD3DXMESH_NOTEXTURES= 0x800,
  296. };
  297.  
  298. enum DXCCTOD3DXFRAME_FLAGS
  299. {
  300.     DXCCTOD3DXFRAME_NONAME= 0x40,
  301.     DXCCTOD3DXFRAME_MANAGEMEMBERS= 0x80, //manage the mesh member's 'next mesh' ptr
  302.     DXCCTOD3DXFRAME_MANAGECHILDREN= 0100, //manage the children's sibling ptr
  303. };
  304.  
  305.  
  306. HINSTANCE DXCCGetHINSTANCE();
  307. HMODULE DXCCGetHMODULE();
  308.  
  309. HRESULT WINAPI
  310.     DXCCWindowlessSetup(
  311.         LPDXCCWINDOW pWindow);
  312.  
  313. HRESULT WINAPI
  314.     DXCCEnumEffectParameters(
  315.         LPD3DXEFFECT pEffect,
  316.         LPDXCCENUMEFFECTPARAMETERS pEnum, 
  317.         bool ContructFullNames,
  318.         bool EnumLeavesOnly);
  319.  
  320. BOOL WINAPI
  321. DXCCFindFile(
  322.     const char* a_szFilepath, 
  323.     const char* a_SecondaryDirectory, 
  324.     DWORD a_FoundLength,
  325.     char* a_FoundFilepath);
  326.  
  327. HRESULT WINAPI
  328. DXSASLoadEffectDefaults(
  329.         LPDIRECT3DDEVICE9 a_pDevice,
  330.         LPDXCCMANAGER a_pManager,//for retrieval of effect and textures path
  331.         LPD3DXEFFECT a_pEffect,
  332.         LPDXCCRESOURCE a_pEffectResource,
  333.         char* a_SecondaryDirectory);
  334.  
  335. HRESULT WINAPI
  336. DXCCLoadTextureFromFile(
  337.     LPDIRECT3DDEVICE9 a_pDevice, 
  338.     LPDXCCMANAGER a_pManager,  
  339.     const char* a_TexFilename,
  340.     const char* a_SecondaryDirectory,     
  341.     LPDXCCRESOURCE* a_ppOutResource,//[out]
  342.     LPDIRECT3DBASETEXTURE9* a_ppOutTexture);//[out]
  343.  
  344.  
  345.  
  346. D3DXHANDLE WINAPI
  347. DXCCFindEffectAnnotation(
  348.     LPD3DXEFFECT pEffect, 
  349.     D3DXHANDLE hParameter, 
  350.     LPCSTR szAnnotation);
  351.  
  352.  
  353. //HRESULT WINAPI
  354. //    DXCCCreateAnimationSet(
  355. //    LPDXCCMANAGER pManager, 
  356. //    LPDXCCFRAME pRoot, 
  357. //    const char* SetName, 
  358. //    DOUBLE TicksPerSecond, 
  359. //    D3DXPLAYBACK_TYPE Playback,  
  360. //    UINT NumCallbackKeys, 
  361. //    CONST LPD3DXKEY_CALLBACK pCallKeys, 
  362. //    LPD3DXKEYFRAMEDANIMATIONSET* ppAnimSet);
  363.  
  364. HRESULT WINAPI
  365.     DXCCSaveScene(
  366.      LPCSTR Filename, 
  367.      DWORD XFormat, 
  368.      LPDXCCMANAGER pManager,
  369.      LPDXCCFRAME pRoot,
  370.      LPD3DXANIMATIONCONTROLLER pAnimation,        //LPD3DXKEYFRAMEDANIMIONSET or LPD3DXANIMATIONCONTROLLER
  371.      LPDXCCSAVESCENEARGS pSaveOptions,
  372.      LPDXCCSAVEUSERDATA pUserDataSaver);
  373.  
  374. HRESULT WINAPI 
  375.     DXCCCreateManager(          
  376.     LPDXCCMANAGER* ppManager);
  377.  
  378. HRESULT WINAPI
  379.     DXCCCreateFrame(
  380.     LPDXCCFRAME* ppFrame);
  381.  
  382. HRESULT WINAPI
  383.     DXCCCreateMesh(
  384.      DWORD NumFaces,
  385.      DWORD NumVertices,
  386.      LPDIRECT3DDEVICE9 pDevice,
  387.      LPD3DVERTEXELEMENT9 pDeclaration,
  388.     LPDXCCMESH* ppMesh);
  389.  
  390. //HRESULT WINAPI
  391. //    DXCCCreateMaterial(
  392. //    LPDXCCMATERIAL *pMaterial);
  393.  
  394. HRESULT WINAPI
  395.     DXCCCreateVertexBundler(
  396.      UINT NumVertices,
  397.      D3DVERTEXELEMENT9* pDecl, 
  398.     LPDXCCVERTEXBUNDLER* ppVBundle);
  399.  
  400. HRESULT WINAPI
  401.     DXCCCreateDeclaration(
  402.     LPDXCCDECLARATION* ppDeclaration);
  403.  
  404. HRESULT WINAPI
  405.     DXCCCreateHeap(
  406.     LPDXCCHEAP* ppHeap);
  407.  
  408. //HRESULT WINAPI
  409. //    DXCCCreateAnimationStream(
  410. //    LPDXCCANIMATIONSTREAM* ppOutAnimStream);    
  411.  
  412. ////create a mesh container optimal for fast editing
  413. //HRESULT WINAPI
  414. //    DXCCCreateMeshFromD3DXMesh(
  415. //        LPD3DXMESH pMesh,
  416. //        //LPD3DXBUFFER pAdjacencies,
  417. //        LPD3DXBUFFER pPointReps,
  418. //        DWORD dxccOptions, 
  419. //        LPDXCCMESH* ppMesh);
  420. //
  421. ////HRESULT WINAPI
  422. //    DXCCCreateMeshFromVertexStreamGroup(
  423. //        LPDXCCVERTEXBUNDLER pVBundle,
  424. //        LPDIRECT3DINDEXBUFFER9  pIndices,
  425. //        LPD3DXBUFFER pAttributes,
  426. //        LPD3DXBUFFER pAdjacencies,
  427. //        LPD3DXBUFFER pPointReps,
  428. //        DWORD dwD3DXoptions,
  429. //        DWORD dxccOptions, 
  430. //        LPDXCCMESH* ppMesh);
  431. //
  432.  
  433. HRESULT WINAPI
  434.     DXCCCreateFrameIterator(
  435.     LPDXCCFRAMEITERATOR* ppIT);
  436.  
  437. //HRESULT WINAPI
  438. //    DXCCCreateMeshIterator(
  439. //    LPDXCCMESHITERATOR* ppIT);
  440.  
  441.  
  442. //HRESULT WINAPI
  443. //    DXCCCreateVertexBundlerFromD3DXMesh(
  444. //        DWORD dxccOptions,
  445. //        LPD3DXMESH pMesh,
  446. //        LPDXCCVERTEXBUNDLER* ppVBundle);
  447.  
  448. LPSTR 
  449. DXCCConvertStringToXFileObjectName(
  450.     LPCSTR szString, 
  451.     LPSTR szOutput, 
  452.     UINT cOutputLength);
  453.  
  454. LPSTR 
  455. DXCCConvertStringToXFilePath(
  456.     LPCSTR szString, 
  457.     LPSTR szOutput,
  458.     UINT cOutputLength);
  459.  
  460. //HRESULT WINAPI
  461. //DXCCShowSaveDialog(
  462. //    DXCCMeshHierarchySave *pOptions);
  463.  
  464. HRESULT WINAPI
  465. DXCCShowEffectDialog(
  466.      HWND hParent,
  467.      LPDIRECT3DDEVICE9 pDevice,
  468.     LPDXCCMANAGER pManager,
  469.      LPDXCCRESOURCE pResource,
  470.     LPDXCCFXDLGCALLBACKS pCallbacks,
  471.      BOOL bChangableEffect,
  472.     BOOL bModal);
  473.  
  474.  
  475.  
  476.  
  477. struct DXCCWindow
  478. {
  479.     HINSTANCE                hInstance;
  480.     HWND                    hWnd;
  481.     LPDIRECT3D9                pD3D9;
  482.     LPDIRECT3DDEVICE9        pD3DDevice9;
  483. };
  484.  
  485. //Key an entire matrix rather than SRT
  486. typedef struct DXCCKEY_MATRIX
  487. {
  488.     FLOAT Time;
  489.     D3DXMATRIX Value;
  490. } *LPDXCCKEY_MATRIX;
  491.  
  492. typedef struct DXCCKEY_TRANSFORM
  493. {
  494.     FLOAT Time;
  495.     D3DXVECTOR3 ValueS;
  496.     D3DXQUATERNION ValueR;
  497.     D3DXVECTOR3 ValueT;
  498. } *LPDXCCKEY_TRANSFORM;
  499.  
  500. struct DXCCSaveSceneArgs
  501. {
  502.     BOOL                             SkipFrames;        //export hieriarchy
  503.     BOOL                             SkipMeshes;        //export meshes
  504.     //BOOL                            SkipVertexPositions;
  505.     //BOOL                            SkipVertexNormals;
  506.     //BOOL                            SkipVertexTangents;
  507.     //BOOL                            SkipVertexBinormals;
  508.     //BOOL                            SkipVertexColors;
  509.     //BOOL                            SkipVertexTextures;
  510.     //BOOL                            SkipVertexPointSizes;
  511.     //BOOL                            SkipVertexBlendWeights;
  512.     //BOOL                            SkipVertexBlendIndices;
  513.     BOOL                             SkipSkins;        //export skins with meshes
  514.     BOOL                             SkipMaterials;    //export materials
  515.     BOOL                             SkipEffects;    //export fx components  materials
  516.     BOOL                             UnqualifyPaths;
  517.     //BOOL                             TexturesAsDDS;    //resave textures to savepath as DDS
  518. };
  519.  
  520.  
  521. //struct DXCCMeshHierarchySave
  522. //{
  523. //    BOOL                             Hierarchy;//export hieriarchy
  524. //    BOOL                             HierarchyCentered;//add centering node
  525. //    D3DXVECTOR3                        HierarchyScale;//provide worldspace scaling for measurement changes
  526. //    //BOOL                             HierarchyCollapsed;//collapse down to 1 node
  527. //
  528. //
  529. //    BOOL                             Mesh;    //export meshes
  530. //    BOOL                             MeshSkinned; //export skins with meshes
  531. //    //BOOL                             MeshLegacyFormat; //export with legacy template formating
  532. //    //LPDXCCDECLARATION                MeshDeclaration; //declaration restrictions //run update symantics on meshes?
  533. //
  534. //
  535. //    BOOL                             Material; //export materials
  536. //    BOOL                             MaterialFX; //export fx components  materials
  537. //    //BOOL                             MaterialResave; //resave texture to new location
  538. //    BOOL                             MaterialUnqualifyPath; //save filename references as unqualified paths
  539. //    //BOOL                             MaterialDDS; //resave textures as dds
  540. //
  541. //    BOOL                             Animation; //export animation
  542. //    LPD3DXANIMATIONCONTROLLER        AnimationController; //add animation to existing controller (multiset support)
  543. //    char                             AnimationName[DXCC_DEFAULT_STRING_LENGTH]; //
  544. //    BOOL                            AnimationKeysOnly; //keyframes only
  545. //    D3DXPLAYBACK_TYPE                AnimationPlaybackType; 
  546. //    DOUBLE                            AnimationSampleFPS;//TicksPerSecond;
  547. //    DOUBLE                            AnimationPlayFPS;//backRatio;
  548. //    DOUBLE                            AnimationStartTime;
  549. //    DOUBLE                            AnimationEndTime;
  550. //    //BOOL                            AnimationMatrixOnly; //as SRT
  551. //    //BOOL                            AnimationMultifile; //save each frame as it's own file
  552. //
  553. //    //BOOL                             OutputTemplates;
  554. //    //BOOL                             OutputAuthorInfo;
  555. //    DWORD                             OutputFormat;//D3DXF_FILEFORMAT_TEXT
  556. //    char                             OutputSaveAs[DXCC_DEFAULT_STRING_LENGTH];
  557. //
  558. //    LPD3DXBUFFER                    UserData;
  559. //
  560. //};
  561.  
  562.  
  563.  
  564.  
  565.  
  566. //Interchanger for Vertex Buffers and shader registers
  567. //privides conversion fucntions to and from standard types.
  568. //converts them into an array of up to 4 values
  569. typedef struct EXPORTDEF DXCCFLOAT4
  570. {
  571. public:
  572.     FLOAT        value[4];
  573.     WORD        flags;
  574.     BYTE        swizzle;
  575.     BYTE        count;
  576.  
  577.     //encode value[4] from the function param
  578.     DXCCFLOAT4* Encode( signed char* pValue,         UINT nCount);    
  579.     DXCCFLOAT4* Encode( unsigned char* pValue,         UINT nCount);    
  580.     DXCCFLOAT4* Encode( signed short* pValue,         UINT nCount);    
  581.     DXCCFLOAT4* Encode( unsigned short* pValue,         UINT nCount);    
  582.     DXCCFLOAT4* Encode( signed int* pValue,             UINT nCount);        
  583.     DXCCFLOAT4* Encode( unsigned int* pValue,         UINT nCount);    
  584.     DXCCFLOAT4* Encode( signed long* pValue,         UINT nCount);    
  585.     DXCCFLOAT4* Encode( unsigned long* pValue,         UINT nCount);    
  586.     DXCCFLOAT4* Encode( float* pValue,                 UINT nCount);            
  587.     DXCCFLOAT4* Encode( double* pValue,                 UINT nCount);            
  588.     DXCCFLOAT4* Encode( D3DXFLOAT16* pValue,         UINT nCount);    
  589.     DXCCFLOAT4* Encode( D3DCOLOR* pValue);                        
  590.     DXCCFLOAT4* Encode( D3DXCOLOR* pValue);                    
  591.     DXCCFLOAT4* Encode( D3DCOLORVALUE* pValue);                
  592.     DXCCFLOAT4* Encode( D3DVECTOR* pValue);                    
  593.     DXCCFLOAT4* Encode( D3DXVECTOR2* pValue);                    
  594.     DXCCFLOAT4* Encode( D3DXVECTOR3* pValue);                    
  595.     DXCCFLOAT4* Encode( D3DXVECTOR4* pValue);                    
  596.     DXCCFLOAT4* Encode( D3DXPLANE* pValue);                    
  597.     DXCCFLOAT4* Encode( D3DXVECTOR2_16F* pValue);                
  598.     DXCCFLOAT4* Encode( D3DXVECTOR3_16F* pValue);                
  599.     DXCCFLOAT4* Encode( D3DXVECTOR4_16F* pValue);                
  600.  
  601.     //decode value[4] into the function param
  602.     DXCCFLOAT4* Decode(  signed char* pValue,         UINT nCount);    
  603.     DXCCFLOAT4* Decode(  unsigned char* pValue,     UINT nCount);    
  604.     DXCCFLOAT4* Decode(  signed short* pValue,         UINT nCount);    
  605.     DXCCFLOAT4* Decode(  unsigned short* pValue,     UINT nCount);    
  606.     DXCCFLOAT4* Decode(  signed int* pValue,         UINT nCount);        
  607.     DXCCFLOAT4* Decode(  unsigned int* pValue,         UINT nCount);    
  608.     DXCCFLOAT4* Decode(  signed long* pValue,         UINT nCount);    
  609.     DXCCFLOAT4* Decode(  unsigned long* pValue,     UINT nCount);    
  610.     DXCCFLOAT4* Decode(  float* pValue,             UINT nCount);            
  611.     DXCCFLOAT4* Decode(  double* pValue,             UINT nCount);            
  612.     DXCCFLOAT4* Decode(  D3DXFLOAT16* pValue,         UINT nCount);    
  613.     DXCCFLOAT4* Decode(  D3DCOLOR* pValue);                    
  614.     DXCCFLOAT4* Decode(  D3DXCOLOR* _pValue);                    
  615.     DXCCFLOAT4* Decode(  D3DCOLORVALUE* pValue);                
  616.     DXCCFLOAT4* Decode(  D3DVECTOR*_pValue);                    
  617.     DXCCFLOAT4* Decode(  D3DXVECTOR2* pValue);                    
  618.     DXCCFLOAT4* Decode(  D3DXVECTOR3* pValue);                    
  619.     DXCCFLOAT4* Decode(  D3DXVECTOR4* pValue);                    
  620.     DXCCFLOAT4* Decode(  D3DXPLANE* pValue);                    
  621.     DXCCFLOAT4* Decode(  D3DXVECTOR2_16F* pValue);                
  622.     DXCCFLOAT4* Decode(  D3DXVECTOR3_16F* pValue);                
  623.     DXCCFLOAT4* Decode(  D3DXVECTOR4_16F* pValue);
  624.  
  625. } *LPDXCCFLOAT4;
  626.  
  627. #undef INTERFACE
  628.  
  629. //THIS US A USER DEFINED CLASS USED AS A PARAMETER FOR DXCCEnumEffectParameters
  630. #define INTERFACE IDXCCEnumEffectParameters
  631. DECLARE_INTERFACE(IDXCCEnumEffectParameters)
  632. {
  633.     struct PathInfo
  634.     {
  635.         D3DXPARAMETER_DESC    Description;
  636.         UINT                Length;
  637.         const LPCSTR*        Names;//array of size Length
  638.         const D3DXHANDLE*    Handles;//array of size Length
  639.  
  640.         LPCSTR MyName() { return (Length > 0)? Names[Length-1] : NULL;}
  641.         LPCSTR ParentName() { return (Length > 1)? Names[Length-2] : NULL;}
  642.         LPCSTR RootName() { return (Length > 0)? Names[0] : NULL;}
  643.         D3DXHANDLE MyHandle() { return (Length > 0)? Handles[Length-1] : NULL;}
  644.         D3DXHANDLE ParentHandle() { return (Length > 1)? Handles[Length-2] : NULL;}
  645.         D3DXHANDLE RootHandle() { return (Length > 0)? Handles[0] : NULL;}
  646.  
  647.     };
  648.  
  649.     STDMETHOD(EnumParameter)(THIS_  LPD3DXEFFECT pEffect, PathInfo& parameter) PURE;
  650. };
  651. #undef INTERFACE
  652.  
  653. #define INTERFACE IDXCCEFFECTDIALOGCALLBACKS
  654. //all functions return E_NOTIMPL for default processing
  655. DECLARE_INTERFACE(IDXCCEffectDlgCallbacks)
  656. {
  657.     //called after standard show procedures are performed
  658.     //manipulate the dialog here such as embedding.
  659.     STDMETHOD(OnShow)(THIS_  
  660.          LPDIRECT3DDEVICE9 pDevice,
  661.          LPDXCCMANAGER pManager,
  662.          LPDXCCRESOURCE pResource) { return E_NOTIMPL; };
  663.  
  664.     //called immediately after the load button is pressed
  665.     STDMETHOD(OnPreLoad)(THIS_  
  666.          HWND hDialog, 
  667.          LPDIRECT3DDEVICE9 pDevice,
  668.          LPDXCCMANAGER pManager,
  669.          LPDXCCRESOURCE pResource,
  670.          LPCSTR szNewEffectFilename) { return E_NOTIMPL; };//return E_NOTIMPL for default processing
  671.  
  672.     //called as a replacement of the standard load...return E_NOTIMPL for default behavior
  673.     //load the effect.
  674.     //recycle the resource with the effect
  675.     //add the appropriate resource path string to the resource
  676.     //change the title of the hDialog
  677.     STDMETHOD(OnLoad)(THIS_  
  678.          HWND hDialog, 
  679.          LPDIRECT3DDEVICE9 pDevice,
  680.          LPDXCCMANAGER pManager,
  681.          LPDXCCRESOURCE pResource,
  682.          LPCSTR szNewEffectFilename) { return E_NOTIMPL; };//return E_NOTIMPL for default processing
  683.     
  684.     //called after load is performed
  685.     STDMETHOD(OnPostLoad)(THIS_  
  686.          HWND hDialog, 
  687.          LPDIRECT3DDEVICE9 pDevice,
  688.          LPDXCCMANAGER pManager,
  689.          LPDXCCRESOURCE pResource,//recycle me
  690.          LPCSTR szNewEffectFilename) { return E_NOTIMPL; };//return E_NOTIMPL for default processing
  691.  
  692.     //when the Parameter is selected
  693.     STDMETHOD(OnParameterSelect)(THIS_  
  694.          HWND hDialog, 
  695.          LPDIRECT3DDEVICE9 pDevice,
  696.          LPDXCCMANAGER pManager,
  697.         LPDXCCRESOURCE pResource,
  698.          LPD3DXEFFECT pEffect,
  699.          D3DXHANDLE hNewParameter,
  700.         HWND hParentWindow,
  701.         HWND* hOutWindow) { return E_NOTIMPL; }; //return E_NOTIMPL for default processing
  702.  
  703.     //when the Parameter Data is applied
  704.     STDMETHOD(OnParameterApply)(THIS_  
  705.          HWND hDialog, 
  706.          LPDIRECT3DDEVICE9 pDevice,
  707.          LPDXCCMANAGER pManager,
  708.          LPDXCCRESOURCE pResource,
  709.          LPD3DXEFFECT pEffect,
  710.          D3DXHANDLE hParameter) { return E_NOTIMPL; }; //return E_NOTIMPL for default processing
  711.  
  712.     //called before standard close procedures are performed
  713.     STDMETHOD(OnClose)(THIS_  
  714.          HWND hDialog, 
  715.          LPDIRECT3DDEVICE9 pDevice,
  716.          LPDXCCMANAGER pManager,
  717.          LPDXCCRESOURCE pResource) { return E_NOTIMPL; };
  718.  
  719. };
  720. #undef INTERFACE
  721.  
  722. #define INTERFACE IDXCCHIERARCHYCALLBACKS
  723. DECLARE_INTERFACE(IDXCCHierarchyCallbacks)
  724. {
  725.     STDMETHOD(OnCreateD3DXFrame)(THIS_ LPDXCCFRAME pThis, LPD3DXFRAME pFrame) PURE;
  726.     STDMETHOD(OnCreateD3DXMeshContainer)(THIS_ LPDXCCMESH pThis, LPD3DXMESHCONTAINER pMesh) PURE;
  727. };
  728. #undef INTERFACE
  729.  
  730. #define INTERFACE IDXCCHeap
  731. DECLARE_INTERFACE_(IDXCCHeap, ID3DXBuffer)
  732. {
  733.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  734.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  735.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  736.  
  737.     //this is the primary memory
  738.     STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
  739.     STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
  740.  
  741.     STDMETHOD_(LPVOID,CreateMemory)(THIS_ DWORD SizeInBytes) PURE;
  742.     STDMETHOD(DeleteMemory)(THIS_ void* Memory) PURE;
  743.     STDMETHOD(SetPrimaryMemory)(THIS_ void* memory) PURE;
  744.  
  745. };
  746. #undef INTERFACE
  747.  
  748.  
  749. #define INTERFACE IDXCCResource
  750. DECLARE_INTERFACE_(IDXCCResource, IUnknown)
  751. {
  752.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  753.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  754.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  755.  
  756.     //get the fast access handle...used with the manager to find this resource
  757.     STDMETHOD_(DXCCHANDLE, GetHandle)(THIS) PURE;
  758.  
  759.     //get the object's creations IID/UUID
  760.     STDMETHOD_(REFIID, GetIID)(THIS) PURE;
  761.  
  762.     //Get the object it is attached to
  763.     //this operates like QueryInterface
  764.     //but fails if object is not attached with AttachObject
  765.     STDMETHOD(GetObject)(THIS_ 
  766.          LPUNKNOWN* ppvObj) PURE;    //output a pointer to the interface
  767.  
  768.     STDMETHOD(QueryObject)(THIS_ 
  769.          REFIID riid,            //what would you like me to query for?
  770.          void** ppvObj) PURE;    //output a pointer to the interface
  771.  
  772.     //reattach an object to the resource 
  773.     //so that the interface can be retrieved from the resource
  774.     STDMETHOD(AttachObject)(THIS_ 
  775.          LPUNKNOWN pValidation) PURE; //you must supply the interface ptr in order to re-attach the object otherwise i dont know if it is deleted
  776.  
  777.     //detach an interface from the resource 
  778.     //a detatched resource can reach ref count of 0
  779.     //but you can no longer GetObject until you re-attach with AttachObject
  780.     //return TRUE if ref count is zero
  781.     //return FALSE if detached or ref count has not reached zero
  782.     STDMETHOD_(BOOL, DetachObject)(THIS) PURE; 
  783.  
  784.     //can I use GetObject to retrieve this object
  785.     STDMETHOD_(BOOL, Attached)(THIS) PURE;
  786.  
  787.     STDMETHOD_(BOOL, Equals)(THIS_ 
  788.          LPUNKNOWN pValidation) PURE; //you must supply the interface ptr in order to re-attach the object otherwise i dont know if it is deleted
  789.  
  790.     //what is my name?
  791.     STDMETHOD_(LPCSTR, GetName)(THIS) PURE;
  792.  
  793.     //what is my name?
  794.     STDMETHOD(SetName)(THIS_ 
  795.          LPCSTR name) PURE;
  796.  
  797.     //what resource did i originate from?
  798.     STDMETHOD_(LPCSTR, GetResourcePath)(THIS) PURE;
  799.  
  800.     //what resource did i originate from?
  801.     STDMETHOD(SetResourcePath)(THIS_ 
  802.          LPCSTR name) PURE;
  803.  
  804.     //Get user data that is stored in this resource
  805.     //use of any1 or all 3 parameters is valid
  806.     STDMETHOD(GetUserData)(THIS_ 
  807.          LPD3DXBUFFER* ppBuffer,    //(optional)the buffer that contains the user data
  808.          void** ppData,            //(optional)the data pointer from inside the buffer(can be retrieved from ppBuffer)
  809.          DWORD* pSize) PURE;        //(optional)the size of the data(can be retrieved from ppBuffer)
  810.  
  811.     //specify user data
  812.     STDMETHOD(SetUserData)(THIS_ 
  813.          LPD3DXBUFFER pBuffer) PURE;
  814.  
  815.     //create a user data without having to do a d3dxcreatebuffer
  816.     STDMETHOD(CreateUserData)(THIS_ 
  817.          DWORD nSizeInBytes) PURE;
  818. };
  819. #undef INTERFACE
  820.  
  821. #define INTERFACE IDXCCManager
  822. DECLARE_INTERFACE_(IDXCCManager, IUnknown)
  823. {
  824.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  825.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  826.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  827.  
  828.  
  829.     //case sensitive
  830.     STDMETHOD(FindResourceByName)(THIS_ 
  831.          LPCSTR szName, 
  832.          DXCCHANDLE hAfter, 
  833.          LPDXCCRESOURCE* ppResource) PURE;
  834.  
  835.     //non case sensitive
  836.     STDMETHOD(FindResourceByResourcePath)(THIS_ 
  837.          LPCSTR szResourcePath, 
  838.          DXCCHANDLE hAfter, //if 0 then it starts from the beginning otherwise if it's a valid handle it searches after
  839.          LPDXCCRESOURCE* ppResource) PURE;
  840.  
  841.     //find a specific interface or derivative interface though QueryForInterface variable
  842.     //ex:good for searching for all texture object since they derive from basetexture
  843.     STDMETHOD(FindResourceByIID)(THIS_ 
  844.          REFIID iid, 
  845.          DXCCHANDLE hAfter, //if 0 then it starts from the beginning otherwise if it's a valid handle it searches after
  846.          LPDXCCRESOURCE* ppResource) PURE;
  847.  
  848.     STDMETHOD(FindResourceByQuery)(THIS_ 
  849.          REFIID iid, 
  850.          DXCCHANDLE hAfter, //if 0 then it starts from the beginning otherwise if it's a valid handle it searches after
  851.          LPDXCCRESOURCE* ppResource) PURE;
  852.  
  853.     //should be the fastest find method
  854.     STDMETHOD(FindResourceByHandle)(THIS_ 
  855.          DXCCHANDLE Handle,
  856.          LPDXCCRESOURCE* ppResource) PURE;
  857.  
  858.     //find an object within the space 
  859.     STDMETHOD(FindResourceByPointer)(THIS_ 
  860.          LPUNKNOWN pFind, //required if finding by handle
  861.          DXCCHANDLE hAfter, //if 0 then it starts from the beginning otherwise if it's a valid handle it searches after
  862.          LPDXCCRESOURCE* ppResource) PURE;
  863.  
  864.     //create a resource
  865.     STDMETHOD(CreateResource)(THIS_ 
  866.          LPUNKNOWN pUnknown, 
  867.          REFIID riid,
  868.          BOOL Attached,
  869.          LPDXCCRESOURCE* ppResource) PURE;
  870.  
  871.     //remove a resource from the manager. 
  872.     //The resource may remain alive if it being referenced by something 
  873.     //but it will not be retrievable though the mananger.
  874.     STDMETHOD(RemoveResource)(THIS_ DXCCHANDLE handle) PURE;
  875.  
  876.     STDMETHOD(RecycleResource)(THIS_ 
  877.         DXCCHANDLE hResource,
  878.         LPUNKNOWN pUnknown, 
  879.         REFIID riid,
  880.         BOOL Attached,
  881.         BOOL EraseMetadata) PURE;//name, path. userdata 
  882.  
  883.     //STDMETHOD_(void*, CreateMemory)(THIS_ DWORD SizeInBytes) PURE;
  884.     //STDMETHOD_(DWORD, FindMemorySize)(THIS_ void* memory) PURE;
  885.     //STDMETHOD_(UINT, AddRefMemory)(THIS_ void* memory) PURE;
  886.     //STDMETHOD_(UINT, ReleaseMemory)(THIS_ void* memory) PURE;
  887.     //translator is another set of memory, set of DWORDs, each indicating an offset of a pointer.
  888.     //STDMETHOD_(SetMemoryTranslator)(THIS_ void* memory, void* translator) PURE;
  889.     //STDMETHOD(ShadowMemory)(THIS_ DWORD SizeInBytes, void* memory) PURE;
  890.  
  891. };
  892.  
  893. //struct DXCCMessage
  894. //{
  895. //    DXCCHANDLE        Handle; //if NULL op on Manager
  896. //    UINT            Message;//GetDecoder based on GUID of Handle and Message
  897. //    LPD3DXBUFFER    Data;
  898. //};
  899. //
  900. //struct    ModifyEffect
  901. //{
  902. //    DXCCHANDLE hMesh;
  903. //    LPCSTR szSemantic;
  904. //    LPCSTR szObject;
  905. //    UINT ObjectIndex;
  906. //    UINT nFloatCount;
  907. //    FLOAT* pFloats;
  908. //    LPCSTR szUnits;
  909. //    LPCSTR szSpace;
  910. //};
  911.  
  912. //#undef INTERFACE
  913. //#define INTERFACE IDXCCSerializer
  914. //DECLARE_INTERFACE(IDXCCSerializer)
  915. //{
  916. //    STDMETHOD_(REFIID,GetIID)(THIS) PURE;
  917. //    STDMETHOD(Encode)(THIS_ HANDLE hFile) PURE;
  918. //    STDMETHOD(Decode)(THIS) PURE;
  919. //};
  920. //
  921. //
  922.  
  923. #undef INTERFACE
  924. #define INTERFACE IDXCCDeclaration
  925. //#define INTERFACE IDXCCDeclarationBuilder
  926. //extends read only functionality of IDXCCDeclarationReadOnly to provide set/edit functionality.
  927. //provides the ability to generate a declaration from scratch.
  928. //DECLARE_INTERFACE_(IDXCCDeclarationBuilder, IDXCCDeclaration)
  929. DECLARE_INTERFACE_(IDXCCDeclaration, IUnknown)
  930. {
  931.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  932.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  933.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  934.  
  935.     //STDMETHOD(Clone)(THIS_ D3DVERTEXELEMENT9* pDecl) PURE;
  936.     STDMETHOD_(BOOL, Identical)(THIS_ 
  937.          CONST D3DVERTEXELEMENT9* pDecl) PURE;
  938.  
  939.     STDMETHOD_(UINT, NumElements)(THIS) PURE;
  940.  
  941.     //1to4 fields per element.
  942.     STDMETHOD_(UINT, NumElementFields)(THIS_ 
  943.          UINT iElement) PURE;
  944.  
  945.     STDMETHOD_(CONST LPD3DVERTEXELEMENT9, GetElements)(THIS) PURE;
  946.  
  947.     STDMETHOD_(CONST LPD3DVERTEXELEMENT9, GetElement)(THIS_ 
  948.          UINT iElement) PURE;
  949.  
  950.     //a custom name can be attached per Element
  951.     STDMETHOD_(LPCSTR, GetElementName)(THIS_ 
  952.          UINT iElement) PURE;
  953.  
  954.     //a custom name can be attached per Element
  955.     STDMETHOD(FindElementByName)(THIS_ 
  956.          LPCSTR name, 
  957.          UINT* piElement, 
  958.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  959.  
  960.     STDMETHOD(FindElementBySemantic)(THIS_ 
  961.          UINT _Usage, 
  962.          UINT _UsageIndex, 
  963.          UINT* piElement, 
  964.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  965.  
  966.     STDMETHOD_(UINT, NumBlendWeightFields)(THIS) PURE;
  967.  
  968.     STDMETHOD_(UINT, NumBlendIndexFields)(THIS) PURE;
  969.  
  970.     STDMETHOD_(UINT, NumTexcoordFields)(THIS_ 
  971.          UINT UsageIndex) PURE;
  972.  
  973.     STDMETHOD(GetPositionElement)(THIS_ 
  974.          UINT* piElement, 
  975.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  976.  
  977.     STDMETHOD(GetPointSizeElement)(THIS_ 
  978.          UINT* piElement,
  979.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  980.  
  981.     STDMETHOD(GetNormalElement)(THIS_ 
  982.          UINT* piElement, 
  983.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  984.  
  985.     STDMETHOD(GetTangentElement)(THIS_ 
  986.          UINT* piElement, 
  987.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  988.  
  989.     STDMETHOD(GetBinormalElement)(THIS_ 
  990.          UINT* piElement, 
  991.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  992.  
  993.     STDMETHOD(GetDiffuseElement)(THIS_ 
  994.          UINT* piElement, 
  995.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  996.  
  997.     STDMETHOD(GetSpecularElement)(THIS_ 
  998.          UINT* piElement, 
  999.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  1000.  
  1001.     STDMETHOD(GetTexcoordElement)(THIS_ 
  1002.          BYTE UsageIndex, 
  1003.          UINT* piElement, 
  1004.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  1005.  
  1006.     STDMETHOD(GetBlendWeightsElement)(THIS_ 
  1007.          UINT* piElement, 
  1008.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  1009.  
  1010.     STDMETHOD(GetBlendIndicesElement)(THIS_ 
  1011.          UINT* piElement, 
  1012.          LPD3DVERTEXELEMENT9* ppElement) PURE;
  1013.  
  1014.     //E_ACCESSDENIED may be returned when the structure is embedded
  1015.     STDMETHOD(SetDeclaration)(THIS_ 
  1016.          DWORD FVF) PURE;
  1017.  
  1018.     //E_ACCESSDENIED may be returned when the structure is embedded
  1019.     STDMETHOD(SetDeclaration)(THIS_ 
  1020.          CONST D3DVERTEXELEMENT9* pDecl) PURE;
  1021.  
  1022.     //a custom name can be attached per Element
  1023.     STDMETHOD(SetElementName)(THIS_ 
  1024.          UINT iElement, 
  1025.          LPCSTR name) PURE;
  1026.  
  1027.     //a custom name can be attached per Element but this is the default name
  1028.     //E_ACCESSDENIED may be returned when the structure is embedded
  1029.     STDMETHOD(SetElementNameToDefault)(THIS_ 
  1030.          UINT iElement) PURE;
  1031.  
  1032.     //E_ACCESSDENIED may be returned when the structure is embedded
  1033.     STDMETHOD(RemoveElement)(THIS_ 
  1034.          UINT Index) PURE;
  1035.  
  1036.     //E_ACCESSDENIED may be returned when the structure is embedded
  1037.     STDMETHOD(InsertElement)(THIS_ 
  1038.          UINT iBefore, //use NumElements() to hit the end
  1039.          LPD3DVERTEXELEMENT9 pNew, 
  1040.          LPCSTR _name) PURE;
  1041.  
  1042.     //E_ACCESSDENIED may be returned when the structure is embedded
  1043.     STDMETHOD(InsertPositionElement)(THIS_ 
  1044.          UINT iBefore) PURE;//use NumElements() to hit the end
  1045.  
  1046.     //E_ACCESSDENIED may be returned when the structure is embedded
  1047.     STDMETHOD(InsertPointSizeElement)(THIS_ 
  1048.          UINT iBefore) PURE;//use NumElements() to hit the end
  1049.  
  1050.     //E_ACCESSDENIED may be returned when the structure is embedded
  1051.     STDMETHOD(InsertNormalElement)(THIS_ 
  1052.          UINT iBefore) PURE;//use NumElements() to hit the end
  1053.  
  1054.     //E_ACCESSDENIED may be returned when the structure is embedded
  1055.     STDMETHOD(InsertTangentElement)(THIS_ 
  1056.          UINT iBefore) PURE;//use NumElements() to hit the end
  1057.  
  1058.     //E_ACCESSDENIED may be returned when the structure is embedded
  1059.     STDMETHOD(InsertBinormalElement)(THIS_ 
  1060.          UINT iBefore) PURE;//use NumElements() to hit the end
  1061.  
  1062.     //E_ACCESSDENIED may be returned when the structure is embedded
  1063.     STDMETHOD(InsertDiffuseElement)(THIS_ 
  1064.          UINT iBefore) PURE;//use NumElements() to hit the end
  1065.  
  1066.     //E_ACCESSDENIED may be returned when the structure is embedded
  1067.     STDMETHOD(InsertSpecularElement)(THIS_ 
  1068.          UINT iBefore) PURE;//use NumElements() to hit the end
  1069.  
  1070.     //E_ACCESSDENIED may be returned when the structure is embedded
  1071.     STDMETHOD(InsertTexcoordElement)(THIS_ 
  1072.          UINT iBefore, //use NumElements() to hit the end
  1073.          UINT iTexIndex, 
  1074.          UINT cCoordCount, 
  1075.          LPCSTR name) PURE; //texcoords should be named for linkage reasons
  1076.  
  1077.     //E_ACCESSDENIED may be returned when the structure is embedded
  1078.     STDMETHOD(InsertBlendWeightsElement)(THIS_ 
  1079.          UINT iBefore) PURE;//use NumElements() to hit the end
  1080.  
  1081.     //E_ACCESSDENIED may be returned when the structure is embedded
  1082.     STDMETHOD(InsertBlendIndicesElement)(THIS_ 
  1083.          UINT iBefore) PURE;//use NumElements() to hit the end
  1084. };
  1085. #undef INTERFACE
  1086.  
  1087. #define INTERFACE IDXCCVertexBundler
  1088. //simple encapsilation of vertex streams
  1089. //this is an interface to simply read/write all of the vertex data associated with a single declaration.
  1090. //the class holds all of the stream information and vertex buffers.
  1091. //but no functionality to set the streams....see derived classes
  1092. //you can read the declaration but not change it.
  1093. //then you can edit the data by element for each vertex of the appropriate vertex buffer.
  1094. DECLARE_INTERFACE_(IDXCCVertexBundler, IUnknown)
  1095. {
  1096.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1097.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1098.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  1099.  
  1100.     //E_ACCESSDENIED may be returned when the structure is embedded
  1101.     STDMETHOD(Recycle)(THIS_ 
  1102.          UINT NumVertices,
  1103.          LPD3DVERTEXELEMENT9 pDecl) PURE;
  1104.  
  1105.     STDMETHOD(GetVertexBuffer)(THIS_ 
  1106.          UINT iStream, 
  1107.          LPDIRECT3DVERTEXBUFFER9* ppVB) PURE;
  1108.  
  1109.     STDMETHOD(GetDeclaration)(THIS_ 
  1110.          LPDXCCDECLARATION* ppDeclRead) PURE;
  1111.     
  1112.     STDMETHOD_(DWORD, NumVertices)(THIS) PURE;
  1113.  
  1114.     //Get data based on arbitrary vertex element
  1115.     STDMETHOD(GetData)(THIS_ 
  1116.          UINT iVertex, 
  1117.          UINT iElem, 
  1118.          DXCCFLOAT4* pVED) PURE;
  1119.  
  1120.     //Get data based on standard vertex element    
  1121.     STDMETHOD(GetPosition)(THIS_ 
  1122.          UINT iVertex, 
  1123.          DXCCFLOAT4* pVED) PURE;
  1124.  
  1125.     STDMETHOD(GetPointSize)(THIS_ 
  1126.          UINT iVertex, 
  1127.          DXCCFLOAT4* pVED) PURE;
  1128.  
  1129.     STDMETHOD(GetNormal)(THIS_ 
  1130.          UINT iVertex, 
  1131.          DXCCFLOAT4* pVED) PURE;
  1132.  
  1133.     STDMETHOD(GetTangent)(THIS_ 
  1134.          UINT iVertex, 
  1135.          DXCCFLOAT4* pVED) PURE;
  1136.  
  1137.     STDMETHOD(GetBinormal)(THIS_ 
  1138.          UINT iVertex, 
  1139.          DXCCFLOAT4* pVED) PURE;
  1140.  
  1141.     STDMETHOD(GetDiffuse)(THIS_ 
  1142.          UINT iVertex, 
  1143.          DXCCFLOAT4* pVED) PURE;
  1144.  
  1145.     STDMETHOD(GetSpecular)(THIS_ 
  1146.          UINT iVertex, 
  1147.          DXCCFLOAT4* pVED) PURE;
  1148.  
  1149.     STDMETHOD(GetTexcoord)(THIS_ 
  1150.          UINT iVertex, 
  1151.          UINT iTexcoord,  
  1152.          DXCCFLOAT4* pVED) PURE;
  1153.  
  1154.     STDMETHOD(GetBlendWeights)(THIS_ 
  1155.          UINT iVertex, 
  1156.          DXCCFLOAT4* pVED) PURE;
  1157.  
  1158.     STDMETHOD(GetBlendIndices)(THIS_ 
  1159.          UINT iVertex, 
  1160.          DXCCFLOAT4* pVED) PURE;
  1161.  
  1162.     //Set data based on arbitrary vertex element
  1163.     STDMETHOD(SetData)(THIS_ 
  1164.          UINT iVertex, 
  1165.          UINT iElem, 
  1166.          DXCCFLOAT4* pVED) PURE;
  1167.  
  1168.     //Set data based on standard vertex element    
  1169.     STDMETHOD(SetPosition)(THIS_ 
  1170.          UINT iVertex,  
  1171.          DXCCFLOAT4* pVED) PURE;
  1172.  
  1173.     STDMETHOD(SetPointSize)(THIS_ 
  1174.          UINT iVertex,  
  1175.          DXCCFLOAT4* pVED) PURE;
  1176.  
  1177.     STDMETHOD(SetNormal)(THIS_ 
  1178.          UINT iVertex,  
  1179.          DXCCFLOAT4* pVED) PURE;
  1180.  
  1181.     STDMETHOD(SetTangent)(THIS_ 
  1182.          UINT iVertex,  
  1183.          DXCCFLOAT4* pVED) PURE;
  1184.  
  1185.     STDMETHOD(SetBinormal)(THIS_ 
  1186.          UINT iVertex,  
  1187.          DXCCFLOAT4* pVED) PURE;
  1188.  
  1189.     STDMETHOD(SetDiffuse)(THIS_ 
  1190.          UINT iVertex,  
  1191.          DXCCFLOAT4* pVED) PURE;
  1192.  
  1193.     STDMETHOD(SetSpecular)(THIS_ 
  1194.          UINT iVertex,  
  1195.          DXCCFLOAT4* pVED) PURE;
  1196.  
  1197.     STDMETHOD(SetTexcoord)(THIS_ 
  1198.          UINT iVertex,  
  1199.          UINT iTexcoord,   
  1200.          DXCCFLOAT4* pVED) PURE;
  1201.  
  1202.     STDMETHOD(SetBlendWeights)(THIS_ 
  1203.          UINT iVertex,  
  1204.          DXCCFLOAT4* pVED) PURE;
  1205.  
  1206.     STDMETHOD(SetBlendIndices)(THIS_ 
  1207.          UINT iVertex,  
  1208.          DXCCFLOAT4* pVED) PURE;
  1209.  
  1210.     //Lock down the vertex buffer.  set up one of 16 vertex streams with full vertex stream data
  1211.     STDMETHOD(Lock)(THIS_  
  1212.          UINT iStream) PURE;
  1213.  
  1214.     STDMETHOD(Unlock)(THIS_  
  1215.          UINT iStream) PURE;
  1216.  
  1217.     STDMETHOD(LockAll)(THIS) PURE;
  1218.  
  1219.     STDMETHOD(UnlockAll)(THIS) PURE;
  1220.  
  1221.     STDMETHOD(SetStream)(THIS_  
  1222.          UINT iStream,  //what stream index do you want? ...see vertex declaration elements
  1223.          UINT OffsetInBytes,  //how far from the beginning of the vertex buffer does the data start
  1224.          UINT Stride,  //how far between vertices
  1225.          UINT iFrequencyDivider,    //instancing    (default is 1)
  1226.          CONST LPDIRECT3DVERTEXBUFFER9 pVB) PURE;
  1227. };
  1228. #undef INTERFACE
  1229.  
  1230. //#define INTERFACE IDXCCMaterial
  1231. ////provides access to all material data from IDXCCMesh
  1232. //DECLARE_INTERFACE_(IDXCCMaterial, IUnknown)
  1233. //{
  1234. //    STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1235. //    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1236. //    STDMETHOD_(ULONG,Release)(THIS) PURE;
  1237. //
  1238. //    /* BASE MATERIAL */
  1239. //    //this is the default material...ie no effect based material colors
  1240. //    STDMETHOD_(D3DMATERIAL9*, GetD3DMaterial)(THIS) PURE;
  1241. //
  1242. //    /* DEFAULT TEXTURE */
  1243. //    //this is the default diffuse texture...providing backward compatability with old xfile loaders
  1244. //    STDMETHOD(GetD3DXMaterialTexture)(THIS_ 
  1245. //         LPDIRECT3DBASETEXTURE9* ppTexture) PURE; 
  1246. //
  1247. //    STDMETHOD(SetD3DXMaterialTexture)(THIS_  
  1248. //         LPDIRECT3DBASETEXTURE9 pTexture) PURE;
  1249. //    
  1250. //    /* EFFECT*/
  1251. //    //Storage of a material's shaders.  this is here primarily to track linkage information and param default values
  1252. //    STDMETHOD(SetEffect)(THIS_  
  1253. //         LPD3DXEFFECT pEffect) PURE;
  1254. //
  1255. //    STDMETHOD(GetEffect)(THIS_  
  1256. //         LPD3DXEFFECT* ppEffect) PURE;
  1257. //};
  1258.  
  1259. #undef INTERFACE
  1260. #define INTERFACE IDXCCMesh
  1261. //This is a derivative of d3dx mesh container.  
  1262. //it provides simple access to all vertex, face, material, bone/skin information
  1263. //which makes up the concept of a renderable mesh
  1264. //It is a hierarchy component which lives under IDXCCFrame
  1265. DECLARE_INTERFACE_(IDXCCMesh, IUnknown)
  1266. {
  1267.     /*** IUnknown methods ***/
  1268.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1269.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1270.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  1271.  
  1272.     //E_ACCESSDENIED may be returned when the structure is embedded
  1273.     STDMETHOD(Recycle)(THIS_ 
  1274.          DWORD NumFaces,
  1275.          DWORD NumVertices,
  1276.          LPDIRECT3DDEVICE9 pDevice,
  1277.          LPD3DVERTEXELEMENT9 pDeclaration) PURE;
  1278.  
  1279.     STDMETHOD_(DWORD, NumVertices)(THIS) PURE;
  1280.     STDMETHOD_(DWORD, NumFaces)(THIS) PURE;
  1281.  
  1282.     //access to declaration and vertex buffers
  1283.     STDMETHOD(GetVertexBundler)(THIS_ 
  1284.          LPDXCCVERTEXBUNDLER* ppVBundle) PURE;
  1285.  
  1286.     //locks and unlocks index buffer (everything else is nonvideo) (attribute and adjacency)
  1287.     STDMETHOD(LockFaces)(THIS) PURE; 
  1288.  
  1289.     //locks and unlocks index buffer (everything else is nonvideo) (attribute and adjacency)
  1290.     STDMETHOD(UnlockFaces)(THIS) PURE;
  1291.  
  1292.     //must  call LockFaces to use 
  1293.     //must  call UnlockFaces to submit geometry to vid card
  1294.     //associate a triangle's local vertex to a vertex  GetVertexBundler
  1295.     STDMETHOD(SetFaceVertex)( 
  1296.          UINT iFace, //0 to NumFaces()-1
  1297.          UINT iLocalVertex, //0 to 2
  1298.          DWORD iVertex) PURE; //0 to NumVertices()-1
  1299.  
  1300.     //must  call LockFaces to use 
  1301.     STDMETHOD(GetFaceVertex)(UINT 
  1302.          iFace, //0 to NumFaces()-1
  1303.          UINT iLocalVertex,//0 to 2
  1304.          DWORD* piVertex) PURE;
  1305.  
  1306.     ///////////////////////////////////////
  1307.     //ADJACENCY
  1308.     ///////////////////////////////////////
  1309.  
  1310.     //adjacency information is for topology based decisions and optimizations
  1311.     STDMETHOD(SetFaceAdjacency)(
  1312.          UINT iFace, //0 to NumFaces()-1
  1313.          UINT iLocalAdjacency, //0 to 2
  1314.          DWORD iNewFace) PURE; //0 to NumFaces()-1
  1315.  
  1316.     STDMETHOD(GetFaceAdjacency)(
  1317.          UINT iFace, //0 to NumFaces()-1
  1318.          UINT iLocalAdjacency, //0 to 2
  1319.          DWORD* piNewFace) PURE;
  1320.  
  1321.     //if you do not wish to provide topology information then it may be generated 
  1322.     STDMETHOD(GenerateAdjacency)(THIS_ 
  1323.          FLOAT Epsilon) PURE; //where epsilon is the max distance between vertices for them to be considered the same point
  1324.  
  1325.     //users may choose to use pointreps at times for convenience. these functions provide conversion.
  1326.     STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ 
  1327.          CONST DWORD* pPRep) PURE;//take pointreps to fix internal adjacency
  1328.  
  1329.     STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ 
  1330.          LPD3DXBUFFER* ppPRep) PURE;//get pointreps instead of adjacency
  1331.  
  1332.  
  1333.     ///////////////////////////////////////
  1334.     //ATTRIBUTES
  1335.     ///////////////////////////////////////
  1336.  
  1337.     //set an ID per face that can be associated with materials though Get/SetAttributedMaterial
  1338.     STDMETHOD(SetFaceAttribute)(
  1339.          UINT iFace, //0 to NumFaces()-1
  1340.          DWORD Attribute) PURE; //any value you would like to group your polygons by
  1341.  
  1342.     STDMETHOD(GetFaceAttribute)(
  1343.          UINT iFace, //0 to NumFaces()-1
  1344.          DWORD* pAttribute) PURE;
  1345.  
  1346.     //get a list of all DWORD attributes that have had materials assigned to them
  1347.     STDMETHOD(GetAttributedMaterialList)(THIS_ 
  1348.          LPD3DXBUFFER* ppbAttribute, //a buffer full of DWORDs.  one for each material assignment
  1349.          DWORD* pNumAttributedMaterials) PURE;
  1350.  
  1351.     //assign a material to a DWORD attributes
  1352.     STDMETHOD(SetAttributedMaterial)(THIS_ 
  1353.          DWORD dwAttribute, 
  1354.          LPD3DXEFFECT pMaterial) PURE;
  1355.          //LPDXCCMATERIAL pMaterial) PURE;
  1356.  
  1357.     //retrieve a material assigned to a DWORD attributes
  1358.     STDMETHOD(GetAttributedMaterial)(THIS_ 
  1359.          DWORD dwAttribute, 
  1360.          LPD3DXEFFECT* ppMaterial) PURE;
  1361.          //LPDXCCMATERIAL* ppMaterial) PURE;
  1362.  
  1363.     STDMETHOD(RemoveAttributedMaterial)(THIS_ 
  1364.         DWORD dwAttribute) PURE;
  1365.  
  1366.     STDMETHOD(RemoveAllAttributedMaterials)(THIS) PURE;
  1367.  
  1368.     STDMETHOD(GetAttributeTable)(THIS_ 
  1369.          LPD3DXBUFFER* ppAttribTable,  //d3dxattribute structures
  1370.          DWORD* pAttribTableSize) PURE;
  1371.  
  1372.     ///////////////////////////////////////
  1373.     //SKIN
  1374.     ///////////////////////////////////////
  1375.     //this sets up the skinning allocation.  all skinning data is lost on set calls
  1376.     STDMETHOD(CreateBones)(THIS_ 
  1377.          DWORD NumBones) PURE; 
  1378.  
  1379.     STDMETHOD_(DWORD, NumBones)(THIS) PURE;        
  1380.  
  1381.     STDMETHOD(SetBoneFrame)(THIS_ 
  1382.          DWORD Bone, //0 to NumBones()-1
  1383.          LPDXCCFRAME pBoneFrame, //the frame of the bone you are associating
  1384.          LPDXCCFRAME pSkinFrame) PURE; // the frame this mesh providing world space relativity
  1385.  
  1386.     STDMETHOD(GetBoneFrame)(THIS_ 
  1387.          DWORD Bone, //0 to NumBones()-1
  1388.          LPDXCCFRAME* ppBoneFrame) PURE;    
  1389.  
  1390.     //matrix that brings a vertex from the mesh's space to the bone's space
  1391.     STDMETHOD(SetBoneOffsetMatrix)(THIS_ 
  1392.          DWORD Bone, //0 to NumBones()-1
  1393.          LPD3DXMATRIX pBone) PURE;    
  1394.  
  1395.     //matrix that brings a vertex from the mesh's space to the bone's space
  1396.     STDMETHOD(GetBoneOffsetMatrix)(THIS_ 
  1397.          DWORD Bone, //0 to NumBones()-1
  1398.          LPD3DXMATRIX* ppBone) PURE;    
  1399.  
  1400.     STDMETHOD(SetBoneInfluence)(THIS_ 
  1401.          DWORD bone, //0 to NumBones()-1
  1402.          UINT iVertex, //0 to NumVertices()-1
  1403.          FLOAT weight) PURE;    //% of total that that bone effects the vertex
  1404.  
  1405.     STDMETHOD(GetBoneInfluence)(THIS_ 
  1406.          DWORD bone, //0 to NumBones()-1
  1407.          UINT iVertex, //0 to NumVertices()-1
  1408.          FLOAT* pWeight) PURE;
  1409.  
  1410.  
  1411.  
  1412. /*    
  1413.     STDMETHOD(SkinCaptureMesh)(THIS_ 
  1414.          LPD3DVERTEXELEMENT9 pDeclaration,//the decl elements that you would like to match by usage & usageIndex
  1415.         DWORD NumBones) PURE;
  1416.  
  1417.     //restore Mesh (skin elements) to captured state
  1418.     STDMETHOD(SkinRestoreMesh)(THIS) PURE;
  1419.     //deform's Mesh (skin elements) to based on bones
  1420.     STDMETHOD(SkinDeformMesh)(THIS) PURE;
  1421.  
  1422.  
  1423.     //Edits to decompiled data are fast
  1424.     STDMETHOD(SkinLock)(THIS) PURE;
  1425.     SkinSetBoneInfluences(DWORD* verts, FLOAT* weights);
  1426.     SkinSetBoneInfluences(FLOAT* weights);
  1427.     SkinSetVertexInfluences(DWORD* verts, FLOAT* weights);
  1428.     SkinSetVertexInfluences(FLOAT* weights);
  1429.     STDMETHOD(SkinUnlock)(THIS) PURE;
  1430.  
  1431.  
  1432.     //this sets up the skinning allocation.  all skinning data is lost on set calls
  1433.     STDMETHOD(SkinCreateBones)(THIS_ 
  1434.          DWORD NumBones) PURE; 
  1435.  
  1436.     STDMETHOD_(DWORD, SkinNumBones)(THIS) PURE;        
  1437.  
  1438.     STDMETHOD(SkinSetBoneFrame)(THIS_ 
  1439.          DWORD Bone, //0 to NumBones()-1
  1440.          LPDXCCFRAME pBoneFrame, //the frame of the bone you are associating
  1441.          LPDXCCFRAME pSkinFrame) PURE; // the frame this mesh providing world space relativity
  1442.  
  1443.     STDMETHOD(SkinGetBoneFrame)(THIS_ 
  1444.          DWORD Bone, //0 to NumBones()-1
  1445.          LPDXCCFRAME* ppBoneFrame) PURE;    
  1446.  
  1447.     //matrix that brings a vertex from the mesh's space to the bone's space
  1448.     STDMETHOD(SkinSetBoneOffsetMatrix)(THIS_ 
  1449.          DWORD Bone, //0 to NumBones()-1
  1450.          LPD3DXMATRIX pBone) PURE;    
  1451.  
  1452.     //matrix that brings a vertex from the mesh's space to the bone's space
  1453.     STDMETHOD(SkinGetBoneOffsetMatrix)(THIS_ 
  1454.          DWORD Bone, //0 to NumBones()-1
  1455.          LPD3DXMATRIX* ppBone) PURE;    
  1456.  
  1457.     STDMETHOD(SkinSetBoneInfluence)(THIS_ 
  1458.          DWORD bone, //0 to NumBones()-1
  1459.          UINT iVertex, //0 to NumVertices()-1
  1460.          FLOAT weight) PURE;    //% of total that that bone effects the vertex
  1461.  
  1462.     STDMETHOD(SkinGetBoneInfluence)(THIS_ 
  1463.          DWORD bone, //0 to NumBones()-1
  1464.          UINT iVertex, //0 to NumVertices()-1
  1465.          FLOAT* pWeight) PURE;
  1466.  
  1467. */
  1468.     //inplace only
  1469.     STDMETHOD(Optimize)(THIS_ 
  1470.          D3DXCLEANTYPE CleanType, 
  1471.          DWORD OptimizeFlags, //use one or more D3DXMESHOPT flags
  1472.          LPD3DXBUFFER* ppFaceRemap, 
  1473.          LPD3DXBUFFER *ppVertexRemap) PURE;  
  1474.  
  1475.     STDMETHOD(DrawSubset)(THIS_ 
  1476.          DWORD AttribId) PURE;
  1477.  
  1478.     //get the index buffer for private rendering
  1479.     STDMETHOD(GetIndexBuffer)(THIS_ 
  1480.          LPDIRECT3DINDEXBUFFER9* ppIB) PURE;
  1481.  
  1482.     STDMETHOD(GetAdjacencyBuffer)(THIS_ 
  1483.          LPD3DXBUFFER* ppBuf) PURE;
  1484.  
  1485.  
  1486.     //pManager is to fetch Name and ResourcePath
  1487.     //flags are DXCCTOD3DX_FLAGS && DXCCTOD3DXMESH_FLAGS
  1488.     STDMETHOD(CreateD3DXMeshContainer)(THIS_ LPDXCCMANAGER pManager, DWORD flags, DWORD ExtensionSize, LPDXCCHIERARCHYCALLBACKS MeshCallback, LPDXCCHEAP pHeap) PURE;
  1489.  
  1490.     //COMING SOON//STDMETHOD(GetIndexedBlendedSkinningInfo)(THIS_ LPD3DXBUFFER* ppBoneCombinationTable, DWORD* pNumBoneCombinations, DWORD* pMaxVertexInfl) PURE;
  1491.     //COMING SOON//STDMETHOD(ConvertToIndexedBlendedSkinning)(THIS_ DWORD paletteSize, DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE;
  1492.     //COMING SOON//STDMETHOD(Clone)(THIS_ CONST D3DVERTEXELEMENT9 *pDeclaration, LPDXCCMESH* ppCloneMesh) PURE; //COMING SOON
  1493.     //COMING SOON//STDMETHOD(Skin)(THIS_ LPDXCCVERTEXBUNDLER pVerticesDst) PURE;
  1494.     //COMING SOON//STDMETHOD(Unskin)(THIS_ LPDXCCVERTEXBUNDLER pVerticesDst) PURE;
  1495. };
  1496.  
  1497.  
  1498. #undef INTERFACE
  1499. #define INTERFACE IDXCCFrame
  1500. DECLARE_INTERFACE_(IDXCCFrame, IUnknown)
  1501. {
  1502.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1503.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1504.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  1505.  
  1506.     //am I the root of a tree? 
  1507.     STDMETHOD_(BOOL, Root)(THIS) PURE;
  1508.  
  1509.     //[IMPLIMENTATION INFO]this should cascade and call RemoveChild on old parent and AddChild on new parent if child is not already retrievable
  1510.     //[IMPLIMENTATION INFO]this should NOT perform AddRef/Release on pParent to avoid circular referencing
  1511.     STDMETHOD(SetParent)(THIS_ 
  1512.          LPDXCCFRAME pParent) PURE;
  1513.  
  1514.     STDMETHOD(GetParent)(THIS_
  1515.          LPDXCCFRAME* ppParent) PURE;
  1516.  
  1517.     STDMETHOD_(UINT, NumChildren)(THIS) PURE;
  1518.  
  1519.     //[IMPLIMENTATION INFO]this should cascade and call SetParent(this) on child if parent is not set properly
  1520.     STDMETHOD(AddChild)(THIS_ 
  1521.          LPDXCCFRAME pChild) PURE;
  1522.  
  1523.     //[IMPLIMENTATION INFO]this should cascade and call SetParent(NULL) on child if parent is not set properly
  1524.     STDMETHOD(RemoveChild)(THIS_ 
  1525.          UINT index) PURE;
  1526.  
  1527.     STDMETHOD(GetChild)(THIS_ 
  1528.          UINT index, 
  1529.          LPDXCCFRAME* ppChild) PURE;
  1530.  
  1531.     //find an object within the space 
  1532.     STDMETHOD(FindChildByHandle)(THIS_ 
  1533.          LPDXCCMANAGER pManager, //required if finding by handle
  1534.          DXCCHANDLE Handle,
  1535.          UINT *pIndex,
  1536.          LPDXCCFRAME* ppChild) PURE;
  1537.  
  1538.     //find an object within the space 
  1539.     STDMETHOD(FindChildByPointer)(THIS_ 
  1540.          LPDXCCFRAME pFind, //required if finding by handle
  1541.          UINT *pIndex) PURE;
  1542.  
  1543.     //objects within this space
  1544.     STDMETHOD_(UINT, NumMembers)(THIS) PURE;
  1545.  
  1546.     //add an object to this space
  1547.     STDMETHOD(AddMember)(THIS_ 
  1548.          LPUNKNOWN pMember) PURE;
  1549.  
  1550.     //remove an object from this space
  1551.     STDMETHOD(RemoveMember)(THIS_ 
  1552.          UINT index) PURE;
  1553.  
  1554.     //get an object within the space by index
  1555.     STDMETHOD(GetMember)(THIS_ 
  1556.          UINT index,  
  1557.          LPUNKNOWN* ppMember) PURE;
  1558.  
  1559.     //get an object within the space by index
  1560.     STDMETHOD(QueryMember)(THIS_ 
  1561.          UINT index, 
  1562.          REFIID riid, 
  1563.          void** ppMember) PURE;
  1564.  
  1565.     //find an object within the space 
  1566.     STDMETHOD(FindMemberByHandle)(THIS_ 
  1567.          LPDXCCMANAGER pManager, //required if finding by handle
  1568.          DXCCHANDLE Handle,
  1569.          UINT *pIndex,
  1570.          LPUNKNOWN* ppMember) PURE;
  1571.  
  1572.     //find an object within the space 
  1573.     STDMETHOD(FindMemberByPointer)(THIS_ 
  1574.          LPUNKNOWN pUnknown, //required if finding by handle
  1575.          UINT *pIndex) PURE;
  1576.  
  1577.     //find an object within the space 
  1578.     STDMETHOD(FindMemberByQuery)(THIS_ 
  1579.          REFIID riid, //required if finding by handle
  1580.          UINT *pIndex,
  1581.          void** ppMember) PURE;
  1582.  
  1583.     //get/set matrix in local space ...ie relative to parent
  1584.     STDMETHOD_(CONST LPD3DXMATRIX, GetLocalMatrix)(THIS) PURE;    
  1585.  
  1586.     STDMETHOD(SetLocalMatrix)(THIS_ 
  1587.          CONST LPD3DXMATRIX pMatrix) PURE;//this affects all m_Children
  1588.  
  1589.     //get/set matrix in world space
  1590.     STDMETHOD_(CONST LPD3DXMATRIX, GetWorldMatrix)(THIS) PURE;
  1591.  
  1592.     STDMETHOD(SetWorldMatrix)(THIS_ 
  1593.          CONST LPD3DXMATRIX pMatrix) PURE;//this affects all m_Children
  1594.  
  1595.     //STDMETHOD(SetLocalAnimation)(THIS_ 
  1596.     //     LPDXCCANIMATIONSTREAM pAnim) PURE;
  1597.  
  1598.     STDMETHOD(GetLocalAnimation)(THIS_ 
  1599.          LPDXCCANIMATIONSTREAM* ppAnim) PURE;
  1600.  
  1601.     //pManager is to fetch Name and ResourcePath
  1602.     //flags are DXCCTOD3DX_FLAGS
  1603.     STDMETHOD(CreateD3DXFrame)(THIS_ LPDXCCMANAGER pManager, DWORD flags, DWORD ExtensionSize, LPDXCCHIERARCHYCALLBACKS MeshCallback, LPDXCCHEAP pHeap) PURE;
  1604.  
  1605.     STDMETHOD(CreateD3DXHierarchy)(THIS_
  1606.         LPDXCCMANAGER pManager,
  1607.         DWORD FrameFlags, 
  1608.         DWORD FrameExtensionSize, 
  1609.         DWORD MeshFlags, 
  1610.         DWORD MeshExtensionSize, 
  1611.         LPDXCCHIERARCHYCALLBACKS pCallbacks,
  1612.         LPDXCCHEAP pHeap) PURE;
  1613.  
  1614.  
  1615. };
  1616.  
  1617. #undef INTERFACE
  1618. #define INTERFACE IDXCCAnimationStream
  1619. DECLARE_INTERFACE_(IDXCCAnimationStream, IUnknown)
  1620. {
  1621.     // ID3DXAnimationSet
  1622.     STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  1623.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1624.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  1625.  
  1626.     // Period
  1627.     STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE;
  1628.     STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE;    // Maps position into animation period
  1629.  
  1630.      // SRT
  1631.     STDMETHOD(GetTransform)(THIS_ 
  1632.         DOUBLE PeriodicPosition,            // Position mapped to period (use GetPeriodicPosition)
  1633.         D3DXVECTOR3 *pScale,                // Returns the scale
  1634.         D3DXQUATERNION *pRotation,          // Returns the rotation as a quaternion
  1635.         D3DXVECTOR3 *pTranslation) PURE;    // Returns the translation
  1636.  
  1637.      // SRT
  1638.     STDMETHOD(GetMatrix)(THIS_ 
  1639.         DOUBLE PeriodicPosition,            // Position mapped to period (use GetPeriodicPosition)
  1640.         D3DXMATRIX *pMatrix) PURE;            // Returns the matrix
  1641.  
  1642.     // Callbacks
  1643.     //STDMETHOD(GetCallback)(THIS_ 
  1644.     //    DOUBLE Position,                    // Position from which to find callbacks
  1645.     //    DWORD Flags,                        // Callback search flags
  1646.     //    DOUBLE *pCallbackPosition,          // Returns the position of the callback
  1647.     //    LPVOID *ppCallbackData) PURE;       // Returns the callback data pointer
  1648.  
  1649.     // Playback
  1650.     STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE;
  1651.     STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE;
  1652.  
  1653.     // Scale keys
  1654.     STDMETHOD_(UINT, NumScaleKeys)(THIS) PURE;
  1655.     STDMETHOD(GetScaleKey)(THIS_ UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE;
  1656.     STDMETHOD(SetScaleKey)(THIS_ UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE;
  1657.     STDMETHOD(FindScaleKey)(THIS_ FLOAT fKeyTime, UINT* pKey, LPD3DXKEY_VECTOR3 pValue) PURE;
  1658.  
  1659.     // Rotation keys
  1660.     STDMETHOD_(UINT, NumRotationKeys)(THIS) PURE;
  1661.     STDMETHOD(GetRotationKey)(THIS_ UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE;
  1662.     STDMETHOD(SetRotationKey)(THIS_ UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE;
  1663.     STDMETHOD(FindRotationKey)(THIS_ FLOAT fKeyTime, UINT* pKey, LPD3DXKEY_QUATERNION pValue) PURE;
  1664.  
  1665.     // Translation keys
  1666.     STDMETHOD_(UINT, NumTranslationKeys)(THIS) PURE;
  1667.     STDMETHOD(GetTranslationKey)(THIS_ UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE;
  1668.     STDMETHOD(SetTranslationKey)(THIS_ UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE;
  1669.     STDMETHOD(FindTranslationKey)(THIS_ FLOAT fKeyTime, UINT* pKey, LPD3DXKEY_VECTOR3 pValue) PURE;
  1670.  
  1671.  
  1672.     STDMETHOD_(UINT, NumTransformKeys)(THIS) PURE;
  1673.     STDMETHOD(GetTransformKey)(THIS_ UINT Key, LPDXCCKEY_TRANSFORM pTransformKey) PURE;
  1674.     STDMETHOD(SetTransformKey)(THIS_ UINT Key, LPDXCCKEY_TRANSFORM pTransformKey) PURE;
  1675.     STDMETHOD(FindTransformKey)(THIS_ FLOAT fKeyTime, UINT* pKey, LPDXCCKEY_TRANSFORM pValue) PURE;
  1676.  
  1677.     STDMETHOD(GetTransformKeyAsMatrix)(THIS_ UINT Key, LPDXCCKEY_MATRIX pMatrixKey) PURE;
  1678.     STDMETHOD(SetTransformKeyAsMatrix)(THIS_ UINT Key, LPDXCCKEY_MATRIX pMatrixKey) PURE;
  1679.     STDMETHOD(FindTransformKeyAsMatrix)(THIS_ FLOAT fKeyTime, UINT* pKey, LPDXCCKEY_MATRIX pValue) PURE;
  1680.  
  1681.  
  1682.     // Callback keys
  1683.     //STDMETHOD_(UINT, NumCallbackKeys)(THIS) PURE;
  1684.     //STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE;
  1685.     //STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE;
  1686.  
  1687.     // Key removal methods. These are slow, and should not be used once the animation starts playing
  1688.     STDMETHOD(RemoveScaleKey)(THIS_ UINT Key) PURE;
  1689.     STDMETHOD(RemoveRotationKey)(THIS_ UINT Key) PURE;
  1690.     STDMETHOD(RemoveTranslationKey)(THIS_ UINT Key) PURE;
  1691.     STDMETHOD(RemoveTransformKey)(THIS_ UINT Key) PURE;
  1692.  
  1693.     // Key removal methods. These are slow, and should not be used once the animation starts playing
  1694.     STDMETHOD(InsertScaleKey)(THIS_ UINT iBeforeKey, LPD3DXKEY_VECTOR3 pScaleKey) PURE;
  1695.     STDMETHOD(InsertRotationKey)(THIS_ UINT iBeforeKey, LPD3DXKEY_QUATERNION pRotationKey) PURE;
  1696.     STDMETHOD(InsertTranslationKey)(THIS_ UINT iBeforeKey, LPD3DXKEY_VECTOR3 pTranslationKey) PURE;
  1697.     STDMETHOD(InsertTransformKey)(THIS_ UINT iBeforeKey, LPDXCCKEY_TRANSFORM pTransformKey) PURE;
  1698.     STDMETHOD(InsertTransformKeyAsMatrix)(THIS_ UINT iBeforeKey, LPDXCCKEY_MATRIX pMatrixKey) PURE;
  1699.  
  1700.     // One-time animaton SRT keyframe registration
  1701.     STDMETHOD(CreateSRTKeys)(THIS_ 
  1702.         DOUBLE TicksPerSecond,
  1703.         D3DXPLAYBACK_TYPE Playback,
  1704.         UINT NumScaleKeys,                              // Number of scale keys
  1705.         UINT NumRotationKeys,                           // Number of rotation keys
  1706.         UINT NumTranslationKeys) PURE;    // Returns the animation index 
  1707.  
  1708.    // One-time animaton Matrix keyframe registration
  1709.     STDMETHOD(CreateTransformKeys)(THIS_ 
  1710.         DOUBLE TicksPerSecond,
  1711.         D3DXPLAYBACK_TYPE Playback,
  1712.         UINT NumTransforms) PURE;    // Returns the animation index 
  1713.  
  1714.     STDMETHOD(DestroyKeys)(THIS) PURE;
  1715.  
  1716.     //STDMETHOD(SetName)(THIS_ char* name) PURE;
  1717.  
  1718.     STDMETHOD(GetD3DXAnimationSet)(THIS_ LPDXCCMANAGER pManager, LPD3DXKEYFRAMEDANIMATIONSET* ppSet) PURE;
  1719.  
  1720.  
  1721. };
  1722.  
  1723.  
  1724. #undef INTERFACE
  1725. //#define INTERFACE IDXCCAnimationSet
  1726. //DECLARE_INTERFACE_(IDXCCAnimationSet, ID3DXKeyframedAnimationSet)
  1727. //{
  1728. //    STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1729. //    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1730. //    STDMETHOD_(ULONG,Release)(THIS) PURE;
  1731. //
  1732. //    //get the stream sizes
  1733. //    STDMETHOD_(UINT, NumMatrices)(THIS) PURE;    
  1734. //
  1735. //    //access a stream element by key index.  the key may be a tick or an actual keyframe
  1736. //    //the find functions can instead find a closest time
  1737. //    STDMETHOD(GetMatrix)(THIS_ UINT iKey, LPDXCCKEY_MATRIX* ppValue) PURE;    
  1738. //
  1739. //    //find  a stream the key/tick index and ptr to keydata closest matching the desired time
  1740. //    STDMETHOD(FindMatrix)(THIS_ FLOAT fKeyTime, UINT* piKey, LPDXCCKEY_MATRIX* ppValue) PURE;    
  1741. //}
  1742.  
  1743.  
  1744.  
  1745. #undef INTERFACE
  1746. #define INTERFACE IDXCCFrameIterator
  1747.  
  1748. DECLARE_INTERFACE_(IDXCCFrameIterator, IUnknown)
  1749. {
  1750.     STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1751.     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1752.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  1753.  
  1754.     STDMETHOD_(BOOL, Done)(THIS) PURE;
  1755.     STDMETHOD(Get)(THIS_ LPDXCCFRAME* ppFrame) PURE;
  1756.     STDMETHOD_(BOOL, Next)(THIS) PURE;
  1757.  
  1758.     STDMETHOD(Reset)(THIS_ LPDXCCFRAME pNewRoot, DXCCIteratorType NewType) PURE;
  1759.     STDMETHOD_(DXCCIteratorType, GetType)(THIS) PURE;
  1760.     STDMETHOD(GetRoot)(THIS_ LPDXCCFRAME* ppFrame) PURE;
  1761.     STDMETHOD_(UINT, GetDepth)(THIS) PURE;
  1762.  
  1763.  
  1764. };
  1765.  
  1766. //#undef INTERFACE
  1767. //#define INTERFACE IDXCCMeshIterator
  1768. //
  1769. //DECLARE_INTERFACE_(IDXCCMeshIterator, IUnknown)
  1770. //{
  1771. //    STDMETHOD(QueryInterface)(THIS_  REFIID riid,  void** ppvObj) PURE;
  1772. //    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1773. //    STDMETHOD_(ULONG,Release)(THIS) PURE;
  1774. //
  1775. //    STDMETHOD_(BOOL, Done)(THIS) PURE;
  1776. //    STDMETHOD(Get)(THIS_ LPDXCCMESH* ppMesh) PURE;
  1777. //    STDMETHOD_(BOOL, Next)(THIS) PURE;
  1778. //    STDMETHOD(Reset)(THIS_ LPDXCCFRAME pNewRoot) PURE;
  1779. //
  1780. //};
  1781.  
  1782. /*
  1783. #undef INTERFACE
  1784. #define INTERFACE IDXCCSaveUserData
  1785.  
  1786. DECLARE_INTERFACE(IDXCCSaveUserData)
  1787. {
  1788.     STDMETHOD(AddFrameChildData)(CONST LPDXCCFRAME pFrame, 
  1789.                             LPD3DXFILESAVEOBJECT pXofSave, 
  1790.                             LPD3DXFILESAVEDATA pXofFrameData) PURE;
  1791.                             
  1792.     STDMETHOD(AddFrameAnimationChildData)(CONST LPDXCCANIMATIONSTREAM *pAnimation, 
  1793.                             LPD3DXFILESAVEOBJECT pXofSave, 
  1794.                             LPD3DXFILESAVEDATA pXofMeshData) PURE;
  1795.  
  1796.     STDMETHOD(AddMeshChildData)(CONST LPDXCCMESH pMesh, 
  1797.                             LPD3DXFILESAVEOBJECT pXofSave, 
  1798.                             LPD3DXFILESAVEDATA pXofMeshData) PURE;
  1799.  
  1800.     //STDMETHOD(AddMeshMaterialChildData)(CONST LPDXCCMATERIAL *pMaterial, 
  1801.     STDMETHOD(AddMeshMaterialChildData)(CONST LPD3DXEFFECT *pMaterial, 
  1802.                            LPD3DXFILESAVEOBJECT pXofSave, 
  1803.                             LPD3DXFILESAVEDATA pXofMeshData) PURE;
  1804.  
  1805.  
  1806.     // NOTE: this is called once per Save.  All top level objects should be added using the 
  1807.     //    provided interface.  One call adds objects before the frame hierarchy, the other after
  1808.     STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE; 
  1809.     STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE;                             
  1810.  
  1811.     // callbacks for the user to register and then save templates to the XFile
  1812.     STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE;                             
  1813.     STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE;                             
  1814. };
  1815. */
  1816.  
  1817.  
  1818. //#undef INTERFACE
  1819. //#define INTERFACE IDXCCSkinInfo
  1820. //DECLARE_INTERFACE_(IDXCCSkinInfo, IDXCCUserData)
  1821. //{
  1822. //    // IUnknown
  1823. //    STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
  1824. //    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  1825. //    STDMETHOD_(ULONG, Release)(THIS) PURE;
  1826. //
  1827. //    STDMETHOD_(DXCCHANDLE, GetHandle)(THIS) PURE;
  1828. //    //IDXCCUserData
  1829. //    STDMETHOD(GetUserData)(THIS_ LPD3DXBUFFER* ppBuffer) PURE;
  1830. //    STDMETHOD(SetUserData)(THIS_ LPD3DXBUFFER pBuffer) PURE;
  1831. //
  1832. //
  1833. //    // Specify the which vertices do each bones influence and by how much
  1834. //    STDMETHOD_(DWORD, NumVertices)(THIS) PURE;
  1835. //    STDMETHOD_(DWORD, NumBones)(THIS) PURE;
  1836. //    STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, UINT iVertex, FLOAT weight) PURE;
  1837. //    STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, UINT iVertex, FLOAT* weights) PURE;
  1838. //
  1839. //    // Bone names are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object
  1840. //    STDMETHOD(SetBoneFrame)(THIS_ DWORD Bone, LPDXCCFRAME pFrame) PURE; // pName is copied to an internal string buffer
  1841. //    STDMETHOD(GetBoneFrame)(THIS_ DWORD Bone, LPDXCCFRAME* ppFrame) PURE; // A pointer to an internal string buffer is returned. Do not free this.
  1842. //    
  1843. //    // Bone offset matrices are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object
  1844. //    STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD Bone, CONST D3DXMATRIX *pBoneTransform) PURE; // pBoneTransform is copied to an internal buffer
  1845. //    STDMETHOD_(LPD3DXMATRIX, GetBoneOffsetMatrix)(THIS_ DWORD Bone) PURE; // A pointer to an internal matrix is returned. Do not free this.
  1846. //
  1847. //    // Apply SW skinning based on current pose matrices to the target vertices.
  1848. //    STDMETHOD(UpdateSkinnedMesh)(THIS_ 
  1849. //        LPDXCCVERTEXBUNDLER pVerticesDst) PURE;
  1850. //
  1851. //    // Takes a mesh and returns a new mesh with per vertex blend weights and a bone combination
  1852. //    // table that describes which bones affect which subsets of the mesh
  1853. //    STDMETHOD(ConvertToBlendedMesh)(THIS_ 
  1854. //        LPD3DXMESH pMesh,
  1855. //        DWORD Options, 
  1856. //        CONST DWORD *pAdjacencyIn, 
  1857. //        LPDWORD pAdjacencyOut,
  1858. //        DWORD* pFaceRemap, 
  1859. //        LPD3DXBUFFER *ppVertexRemap, 
  1860. //        DWORD* pMaxFaceInfl,
  1861. //        DWORD* pNumBoneCombinations, 
  1862. //        LPD3DXBUFFER* ppBoneCombinationTable, 
  1863. //        LPD3DXMESH* ppMesh) PURE;
  1864. //
  1865. //    // Takes a mesh and returns a new mesh with per vertex blend weights and indices 
  1866. //    // and a bone combination table that describes which bones palettes affect which subsets of the mesh
  1867. //    STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ 
  1868. //        LPD3DXMESH pMesh,
  1869. //        DWORD Options, 
  1870. //        DWORD paletteSize, 
  1871. //        CONST DWORD *pAdjacencyIn, 
  1872. //        LPDWORD pAdjacencyOut, 
  1873. //        DWORD* pFaceRemap, 
  1874. //        LPD3DXBUFFER *ppVertexRemap, 
  1875. //        DWORD* pMaxVertexInfl,
  1876. //        DWORD* pNumBoneCombinations, 
  1877. //        LPD3DXBUFFER* ppBoneCombinationTable, 
  1878. //        LPD3DXMESH* ppMesh) PURE;
  1879. //};
  1880.  
  1881.  
  1882.  
  1883. //#undef INTERFACE
  1884. //#define INTERFACE IDXCCParent
  1885. //DECLARE_INTERFACE_(IDXCCParent, IUnknown)
  1886. //{
  1887. //    GetParent(LPDXCCFRAME* ppParent)
  1888. //    SetParent(LPDXCCFRAME pParent)
  1889. //}
  1890. //
  1891. //#undef INTERFACE
  1892. //#define INTERFACE IDXCCMembers
  1893. //DECLARE_INTERFACE_(IDXCCMembers, IUnknown)
  1894. //
  1895. //#undef INTERFACE
  1896. //#define INTERFACE IDXCCChildren
  1897. //DECLARE_INTERFACE_(IDXCCChildren, IUnknown)
  1898. //
  1899.  
  1900. #endif //__DXCC_H__
  1901.